Integrand size = 14, antiderivative size = 93 \[ \int (c+d x)^2 \cot (a+b x) \, dx=-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3} \]
[Out]
Time = 0.18 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3798, 2221, 2611, 2320, 6724} \[ \int (c+d x)^2 \cot (a+b x) \, dx=\frac {d^2 \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i (c+d x)^3}{3 d} \]
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3798
Rule 6724
Rubi steps \begin{align*} \text {integral}& = -\frac {i (c+d x)^3}{3 d}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)^2}{1-e^{2 i (a+b x)}} \, dx \\ & = -\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {(2 d) \int (c+d x) \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = -\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {\left (i d^2\right ) \int \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right ) \, dx}{b^2} \\ & = -\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^3} \\ & = -\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(356\) vs. \(2(93)=186\).
Time = 1.61 (sec) , antiderivative size = 356, normalized size of antiderivative = 3.83 \[ \int (c+d x)^2 \cot (a+b x) \, dx=\frac {3 i b^2 c d \pi x+i b^3 d^2 x^3-6 i b^2 c d x \arctan (\tan (a))+3 b^3 c d x^2 \cot (a)+3 b c d \pi \log \left (1+e^{-2 i b x}\right )+3 b^2 d^2 x^2 \log \left (1-e^{-i (a+b x)}\right )+3 b^2 d^2 x^2 \log \left (1+e^{-i (a+b x)}\right )+6 b^2 c d x \log \left (1-e^{2 i (b x+\arctan (\tan (a)))}\right )+6 b c d \arctan (\tan (a)) \log \left (1-e^{2 i (b x+\arctan (\tan (a)))}\right )-3 b c d \pi \log (\cos (b x))+3 b^2 c^2 \log (\sin (a+b x))-6 b c d \arctan (\tan (a)) \log (\sin (b x+\arctan (\tan (a))))+6 i b d^2 x \operatorname {PolyLog}\left (2,-e^{-i (a+b x)}\right )+6 i b d^2 x \operatorname {PolyLog}\left (2,e^{-i (a+b x)}\right )-3 i b c d \operatorname {PolyLog}\left (2,e^{2 i (b x+\arctan (\tan (a)))}\right )+6 d^2 \operatorname {PolyLog}\left (3,-e^{-i (a+b x)}\right )+6 d^2 \operatorname {PolyLog}\left (3,e^{-i (a+b x)}\right )-3 b^3 c d e^{i \arctan (\tan (a))} x^2 \cot (a) \sqrt {\sec ^2(a)}}{3 b^3} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 476 vs. \(2 (81 ) = 162\).
Time = 1.13 (sec) , antiderivative size = 477, normalized size of antiderivative = 5.13
method | result | size |
risch | \(\frac {c^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )}{b}-\frac {2 c^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}+\frac {c^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b}+i c^{2} x +\frac {4 i d^{2} a^{3}}{3 b^{3}}-i d c \,x^{2}-\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a^{2}}{b^{3}}+\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x^{2}}{b}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x^{2}}{b}-\frac {2 i d^{2} \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}-\frac {2 i d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}+\frac {2 d c \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x}{b}+\frac {2 d c \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{2}}+\frac {4 c d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {2 c d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b^{2}}+\frac {2 d c \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b}-\frac {2 i d c \,a^{2}}{b^{2}}-\frac {2 i d c \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {2 i d c \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {2 i d^{2} a^{2} x}{b^{2}}+\frac {i c^{3}}{3 d}-\frac {i d^{2} x^{3}}{3}+\frac {2 d^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {2 d^{2} \operatorname {polylog}\left (3, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}-\frac {2 d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b^{3}}-\frac {4 i d c x a}{b}\) | \(477\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 502 vs. \(2 (78) = 156\).
Time = 0.27 (sec) , antiderivative size = 502, normalized size of antiderivative = 5.40 \[ \int (c+d x)^2 \cot (a+b x) \, dx=\frac {2 \, d^{2} {\rm polylog}\left (3, \cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, \cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, -\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, -\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right )}{2 \, b^{3}} \]
[In]
[Out]
\[ \int (c+d x)^2 \cot (a+b x) \, dx=\int \left (c + d x\right )^{2} \cos {\left (a + b x \right )} \csc {\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 411 vs. \(2 (78) = 156\).
Time = 0.30 (sec) , antiderivative size = 411, normalized size of antiderivative = 4.42 \[ \int (c+d x)^2 \cot (a+b x) \, dx=\frac {6 \, c^{2} \log \left (\sin \left (b x + a\right )\right ) - \frac {12 \, a c d \log \left (\sin \left (b x + a\right )\right )}{b} + \frac {6 \, a^{2} d^{2} \log \left (\sin \left (b x + a\right )\right )}{b^{2}} + \frac {-2 i \, {\left (b x + a\right )}^{3} d^{2} - 6 \, {\left (i \, b c d - i \, a d^{2}\right )} {\left (b x + a\right )}^{2} + 12 \, d^{2} {\rm Li}_{3}(-e^{\left (i \, b x + i \, a\right )}) + 12 \, d^{2} {\rm Li}_{3}(e^{\left (i \, b x + i \, a\right )}) - 6 \, {\left (-i \, {\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (-i \, b c d + i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 6 \, {\left (i \, {\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (i \, b c d - i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 12 \, {\left (i \, b c d + i \, {\left (b x + a\right )} d^{2} - i \, a d^{2}\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 12 \, {\left (i \, b c d + i \, {\left (b x + a\right )} d^{2} - i \, a d^{2}\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + 3 \, {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + 3 \, {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right )}{b^{2}}}{6 \, b} \]
[In]
[Out]
\[ \int (c+d x)^2 \cot (a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \cos \left (b x + a\right ) \csc \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x)^2 \cot (a+b x) \, dx=\int \frac {\cos \left (a+b\,x\right )\,{\left (c+d\,x\right )}^2}{\sin \left (a+b\,x\right )} \,d x \]
[In]
[Out]